|
|
|
You sometimes need to be
able to build objects by combining them out of others. You already know this
from procedural programming, where you have the
|
|
structure or record
construct to put data of various types together.
|
|
Let's come back to our
drawing program. You already have created several classes for the available
figures. Now you decide that you want to have a special figure
|
|
which represents your own
logo which consists of a circle and a triangle. (Let's assume, that you
already have defined a class Triangle.) Thus, your logo consists of
|
|
two parts or the circle and
triangle are part-of your logo.
|